package com.icehand.canal.config;

import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.Map;
import java.util.Set;

/**
 * @author icehand
 */
@ConfigurationProperties(prefix = "canal.client")
@Component
@Data
public class CanalConfig {
    private Map<String, Instance> instances = Maps.newHashMap();

    @Data
    public static class Instance {
        private boolean clusterEnabled;
        private Set<String> zookeeperAddress = Sets.newHashSet();
        private String host = "127.0.0.1";
        private int port = 11111;
        private String userName = "";
        private String password = "";
        private int batchSize = 1000;
        private String filter;
        private int retryCount = 3;
        private long acquireInterval = 1000;
    }
}
